Skip to content

refactor: remove redundant level property from typed logger calls#708

Open
kamilwronka wants to merge 1 commit intodevelopfrom
claude/naughty-hoover
Open

refactor: remove redundant level property from typed logger calls#708
kamilwronka wants to merge 1 commit intodevelopfrom
claude/naughty-hoover

Conversation

@kamilwronka
Copy link
Copy Markdown
Contributor

@kamilwronka kamilwronka commented Apr 8, 2026

Summary

  • Removed redundant level: "error" property from logger.error() calls and level: "warn" from logger.warn() calls across 3 files
  • Changed one logger.log({ level: "warn" }) to logger.warn() for consistency
  • Winston's typed methods (.error(), .warn()) already set the level, making the explicit property a no-op

Files touched

  • apps/activity/src/activities/services/activities-events.service.ts — 3 redundant level properties removed
  • apps/api/src/kills/kills.service.ts — 2 redundant level properties removed
  • apps/api/src/timers/timers.service.ts — 2 redundant level properties removed

Why this is safe

  • The level property was identical to what the method already sets — removing it produces identical log output
  • No behavior change, no new abstractions, no API surface changes
  • Lint, format, and tests pass (pre-existing unrelated test failure in activities.controller.spec.ts due to @lootlog/nest-shared package resolution)

Residual risks

  • None. This is a pure redundancy removal with no functional impact.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Standardized logging calls across multiple services by removing redundant configuration parameters and aligning with logger method conventions.

When using Winston's `.error()` or `.warn()` methods, the level is
already set by the method itself. Passing `level: "error"` to
`.error()` or `level: "warn"` to `.warn()` is redundant.

Also changed one `.log({ level: "warn" })` call to `.warn()` for
consistency within the same file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4765b11a-d14f-4c56-8357-7a7fd7f59b58

📥 Commits

Reviewing files that changed from the base of the PR and between f99033e and bfeb178.

📒 Files selected for processing (3)
  • apps/activity/src/activities/services/activities-events.service.ts
  • apps/api/src/kills/kills.service.ts
  • apps/api/src/timers/timers.service.ts
💤 Files with no reviewable changes (2)
  • apps/api/src/kills/kills.service.ts
  • apps/api/src/timers/timers.service.ts

📝 Walkthrough

Walkthrough

Three service files across activity and API modules have logging calls refactored to remove explicit level fields, standardizing on logger method names (e.g., error(), warn()) instead of generic log({ level: ... }) calls.

Changes

Cohort / File(s) Summary
Activity Service Logging
apps/activity/src/activities/services/activities-events.service.ts
Removed explicit level: "error" fields from error logging calls and updated DLQ handler to use warn() method instead of generic log() with level parameter.
API Services Logging
apps/api/src/kills/kills.service.ts, apps/api/src/timers/timers.service.ts
Removed explicit level fields from logger calls in catch blocks and warning logs, standardizing on direct logger method invocations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Logs now flow with cleaner grace,
Method names mark each right place,
No more levels hidden inside,
Winston speaks with honest pride!
✨ Refactored with a hoppy smile!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: removing redundant level properties from typed logger calls across multiple services.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/naughty-hoover

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant